package com.benin.sms.model

import com.benin.sms.valipetrpide.ValGlobalConstant

data class RevAppVersion(val code: String, val msg: String, val obj: RevObjAppVersion) {

    data class RevObjAppVersion(
        val name: String = ValGlobalConstant.VAL_PRODUCT,
        val content: String = "Fixed some bugs.",
        val version: String = "0",
        val linkUrl: String = "https://play.google.com/store/apps/details?id=com.xaf.sms",
        val isFocus: String = "YES",
    ){
        fun isNeedToUpdate(): Boolean {
            val serVesion = this.version.toIntOrNull()
            serVesion?.let {
                return (serVesion > ValGlobalConstant.VAL_APP_VERSION)
            }
            return false
        }

        fun isUpdateFocus(): Boolean {
            return this.isFocus.equals("YES", true)
        }
    }
}
